@import "../../styles/variables.scss";

$input-large-padding: 12px 16px;
$input-large-font-size: 16px;

$input-small-padding: 4px 8px;
$input-small-font-size: 12px;

.mute-input-basic {
  border: 1px solid $disabled-color;
  padding: 8px 12px;
  outline: none;
  border-radius: 2px;
  width: calc(100% - 24px);
  transition: all .3s;
  font-size: $font-size-base;
  color: $text-color-base;
  line-height: $font-size-base;

  &:hover {
    border-color: $primary-color;
    transition: all .3s;
  }

  &:focus {
    border-color: $primary-color;
    box-shadow: 0 0 0 2px rgba($color: $primary-color, $alpha: .25);
    transition: all .3s;
  }

  &[class~="mute-input-basic-lg"] {
    padding: $input-large-padding;
    font-size: $input-large-font-size;
    line-height: $input-large-font-size;
    width: calc(100% - 32px);
  }

  &[class~="mute-input-basic-sm"] {
    padding: $input-small-padding;
    font-size: $input-small-font-size;
    line-height: $input-small-font-size;
    width: calc(100% - 16px);
  }
}

.mute-input-wrapper {
  display: flex;
  align-items: center;
  background-color: lighten($disabled-color, 80);
  border-radius: 2px;
  border: 1px solid $disabled-color;

  .mute-input-addonbefore,
  .mute-input-addonafter {
    padding: 0 4px;
    color: $text-color-base;
    font-size: $font-size-base;
    flex-grow: 0;
    flex-shrink: 0;
  }

  .mute-input-addonbefore {
    padding-left: 12px;
  }

  .mute-input-addonafter {
    padding-right: 12px;
  }

  .mute-input {
    border-radius: 0;
    border: none;
    outline: 1px solid transparent;

    &:hover {
      outline-color: $primary-color;
    }

    &:focus {
      outline-color: $primary-color;
      box-shadow: 0 0 0 3px rgba($color: $primary-color, $alpha: .25);
    }
  }
}

.mute-input-basic-wrapper {
  position: relative;
  width: calc(100% - 2px);

  .mute-input-clear {
    user-select: none;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%) rotateX(40deg);
    border-radius: 50%;
    background-color: #fff;
    font-size: 12px;
    padding: 0px 4px;
    color: #fff;
    cursor: pointer;
    background-color: rgba($color: #000000, $alpha: .25);
    transition: all .3s;

    &:hover {
      background-color: rgba($color: #000000, $alpha: .5);
      transition: all .3s;
    }

    & ~ .mute-input-basic {
      padding-right: 30px;
      width: calc(100% - 42px);

      &[class~="mute-input-basic-lg"] {
        padding: $input-large-padding + 18px;
        width: calc(100% - 50px);
      }
    
      &[class~="mute-input-basic-sm"] {
        padding: $input-small-padding + 18px;
        width: calc(100% - 34px);
      }
    }
  }
}